<template>
   <span>{{ msg }}</span><br />
  <button @click="run">方法调用其他方法</button>
</template>

<script>
import { reactive, toRefs } from 'vue'

export default {
  setup () {
    const state = reactive({
      msg: 'hello'
    })

    const getMsg = () => {
      alert(state.msg)
    }
    const run = () => {
      getMsg()
    }
    return {
      ...toRefs(state),
      run
    }
  }
}
</script>
<style scoped>
  span {
    font-size: 28px;
  }
</style>